// src/stores/counterStore.js
export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  const double = computed(() => count.value * 2)
  function increment() {
    count.value++
  }
  function decrement() {
    if (count.value > 0) {
      count.value--
    }
  }
  function reset() {
    count.value = 0
  }
  return { count, double, increment, decrement, reset }
})